package cn.jason.ymcc.doc;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Document(indexName = "course" , type = "_doc")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CourseDoc {

    @Id
    private Long id;
    //课程名字要分词
    @Field(type= FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String name;

    @Field(type= FieldType.Keyword) //整体搜索，不分词
    private String gradeName;

    @Field(type= FieldType.Keyword)
    private String forUser;//使用人群

    @Field(type= FieldType.Long)
    private Long courseTypeId;//课程分类ID

    @Field(type= FieldType.Keyword)
    private String courseTypeName;//课程分类名

    @Field(type= FieldType.Keyword)
    private String pic;

    @Field(type= FieldType.Integer)
    private Integer totalMinute;

    @Field(type= FieldType.Date)
    private Date onlineTime;

    @Field(type= FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String teacherNames;

    @Field(type= FieldType.Keyword)
    private String chargeName;// 收费1免费，2收费

    @Field(type= FieldType.Double)
    private BigDecimal price;

    @Field(type= FieldType.Double)
    private BigDecimal priceOld;

    @Field(type= FieldType.Integer)
    private Integer saleCount;

    @Field(type= FieldType.Integer)
    private Integer viewCount;

    @Field(type= FieldType.Integer)
    private Integer commentCount;




}
